<!DOCTYPE html>
<html>
<head>
    <title>订单管理:奖金兑换订单</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="!detail&&showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="2">
                    <i-input v-model="q.orderNo" @on-enter="query" placeholder="订单号"/>
                </i-col>
                <i-col span="2">
                    <i-input v-model="q.userPhone" @on-enter="query" placeholder="手机号"/>
                </i-col>
                <i-col span="2">
                    <i-select v-model="q.payStatus" placeholder="支付状态">
                        <i-option value="1">未支付</i-option>
                        <i-option value="2">已支付</i-option>
                    </i-select>
                </i-col>
                <i-col span="2">
                    <i-select v-model="q.status" placeholder="订单状态">
                        <i-option value="1">未支付</i-option>
                        <i-option value="2">支付完成</i-option>
                        <i-option value="3">已取消</i-option>
                        <i-option value="4">已完成</i-option>
                        <i-option value="5">待发货</i-option>
                        <i-option value="6">已发货</i-option>
                        <i-option value="9">退款处理</i-option>
                        <i-option value="10">退款中</i-option>
                        <i-option value="11">退款完成</i-option>
                    </i-select>
                </i-col>
                <i-col span="2">
                    <Date-picker type="date" placement="bottom-end"  v-model="q.date" placeholder="选择日期"
                                 format="yyyy-MM-dd">
                    </Date-picker>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("orderamount:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("orderamount:info"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;查看</i-button>
                #end
                #if($shiro.hasPermission("orderamount:detail"))
                <i-button type="warning" @click="openDetail">详情</i-button>
                #end
                #if($shiro.hasPermission("orderamount:update"))
                <i-button type="warning" @click="update">修改</i-button>
                #end
                #if($shiro.hasPermission("orderamount:send"))
                <i-button type="warning" @click="sendGoods">确认发货</i-button>
                #end
                #if($shiro.hasPermission("orderamount:delete"))
                <i-button type="error" @click="del">删除</i-button>
                #end
                #if($shiro.hasPermission("orderamount:export"))
                <i-button type="warning" @click="exportPro"><i class="fa fa-pencil-square-o"></i>&nbsp;导出</i-button>
                #end
            </div>
        </Row>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <Card v-show="showadd">
        <p slot="title" style="height: auto">
            {{title}}
        </p>
        <i-form ref="formValidate" :model="orderspc" :label-width="80">
            <Form-item label="订单号" prop="orderNo">
                <i-input v-model="orderspc.orderNo" readonly/>
            </Form-item>
            <Form-item label="支付状态" prop="payStatus">
                <i-select v-model="orderspc.payStatus" >
                    <i-option value="0" >未支付</i-option>
                    <i-option value="2">已支付</i-option>
                </i-select>
            </Form-item>
            <Form-item label="订单类型" prop="type">
                <Radio-group v-model="orderspc.type">
                    <Radio label="1">
                        <span>价格单</span>
                    </Radio>
                    <Radio label="2">
                        <span>兑换单</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="用户id"  prop="userId">
                <i-input v-model="orderspc.userId"   readonly/>
            </Form-item>
            <Form-item label="用户名"  prop="userName">
                <i-input v-model="orderspc.userName"   />
            </Form-item>
            <Form-item label="用户手机号"  prop="userPhone">
                <i-input v-model="orderspc.userPhone"  />
            </Form-item>
            <Form-item label="产品编号"  prop="productId">
                <i-input v-model="orderspc.productId"  />
            </Form-item>
            <Form-item label="产品名称"  prop="productName">
                <i-input v-model="orderspc.productName"  />
            </Form-item>
            <Form-item label="产品图"  prop="productUrl">
                <i-input v-model="orderspc.productUrl"  />
            </Form-item>
            <Form-item label="交易金额" prop="amount">
                <i-input v-model="orderspc.amount" />
            </Form-item>
            <Form-item label="实际支付" prop="realAmount">
                <i-input v-model="orderspc.realAmount" />
            </Form-item>
            <Form-item label="收货人" prop="receiveUser">
                <i-input v-model="orderspc.receiveUser"  />
            </Form-item>
            <Form-item label="联系电话" prop="receivePhone"  placeholder="联系电话">
                <i-input v-model="orderspc.receivePhone" />
            </Form-item>
            <Form-item label="收货地址" prop="addressStr"  placeholder="收货地址">
                <i-input v-model="orderspc.addressStr" />
            </Form-item>
            <Form-item label="付款时间" prop="payDate"  placeholder="付款时间">
                <Date-picker v-model="orderspc.payDate" placeholder="付款时间" readonly/>
            </Form-item>
            <Form-item label="物流编号" prop="logisticsno" placeholder="物流编号">
                <i-input v-model="orderspc.logisticsno" />
            </Form-item>
            <Form-item label="物流状态" prop="logisticsStatus" placeholder="物流状态">
                <Radio-group v-model="orderspc.logisticsStatus">
                    <Radio label="300" disabled>
                        <span>订单已发货</span>
                    </Radio>
                    <Radio label="301" disabled>
                        <span>用户确认收货</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="商家编号" prop="merchantId">
                <Input-number :min="1" :step="1" v-model="orderspc.merchantId" placeholder="商家编号"
                              style="width: 188px;"/>
            </Form-item>
            <Form-item label="商家名称" prop="merchantName">
                <i-input v-model="orderspc.merchantName" />
           </Form-item>
            <Form-item label="服务费率" prop="rate">
                <i-input v-model="orderspc.rate" />
            </Form-item>
            <Form-item label="服务费" prop="rateValue">
                <i-input v-model="orderspc.rateValue" />
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="saveOrUpdate">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
    </Card>

    <Card v-show="detail&!showadd">
        <p slot="title" style="height: auto">
            {{title}}
        </p>
        <i-form ref="formValidate" :model="orderspc" :label-width="80">
            <Form-item label="订单号" prop="orderSn">
                <i-input v-model="orderspc.orderSn" readonly/>
            </Form-item>
            <Form-item label="用户名"  prop="userName">
                <i-input v-model="orderspc.userName" readonly/>
            </Form-item>
            <Form-item label="订单类型" prop="orderType">
                <i-select v-model="orderspc.orderType" disabled>
                    <i-option value="1">普通订单</i-option>
                    <i-option value="2">团购订单</i-option>
                    <i-option value="3">砍价订单</i-option>
                    <i-option value="4">立即购买</i-option>
                    <i-option value="5">手工订单（微信支付）</i-option>
                    <i-option value="6">手工订单（其他支付）</i-option>
                </i-select>
            </Form-item>
            <Form-item label="订单状态" prop="orderStatus" >
                <Radio-group v-model="orderspc.orderStatus">
                    <Radio label="0" disabled>
                        <span>待付款</span>
                    </Radio>
                    <Radio label="101" disabled>
                        <span>订单已取消</span>
                    </Radio>
                    <Radio label="102" disabled>
                        <span>订单已删除</span>
                    </Radio>
                    <Radio label="201" disabled>
                        <span>订单已付款</span>
                    </Radio>
                    <Radio label="300" disabled>
                        <span>订单已发货</span>
                    </Radio>
                    <Radio label="301" disabled>
                        <span>用户确认收货</span>
                    </Radio>
                    <Radio label="401" disabled>
                        <span>退款</span>
                    </Radio>
                    <Radio label="402" disabled>
                        <span>完成</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="发货状态" prop="shippingStatus">
                <Radio-group v-model="orderspc.shippingStatus">
                    <Radio label="0" disabled>
                        <span>待发货</span>
                    </Radio>
                    <Radio label="1" disabled>
                        <span>已发货</span>
                    </Radio>
                    <Radio label="2" disabled>
                        <span>已收货</span>
                    </Radio>
                    <Radio label="4" disabled>
                        <span>退货</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="付款状态" prop="payStatus">
                <Radio-group v-model="orderspc.payStatus">
                    <Radio label="0" disabled>
                        <span>待付款</span>
                    </Radio>
                    <Radio label="1" disabled>
                        <span>付款中</span>
                    </Radio>
                    <Radio label="2" disabled>
                        <span>已付款</span>
                    </Radio>
                </Radio-group>
            </Form-item>
            <Form-item label="收货人" prop="consignee">
                <i-input v-model="orderspc.consignee" readonly/>
            </Form-item>
            <Form-item label="收货地址" prop="address">
                <i-input v-model="orderspc.address" readonly/>
            </Form-item>
            <Form-item label="联系电话" prop="mobile">
                <i-input v-model="orderspc.mobile" readonly/>
            </Form-item>
            <Form-item label="快递公司" prop="shippingName">
                <i-input v-model="orderspc.shippingName" readonly/>
            </Form-item>
            <Form-item label="快递单号" prop="shippingNo">
                <i-input v-model="orderspc.shippingNo" readonly/>
            </Form-item>
            <Form-item label="付款方" prop="payName">
                <i-input v-model="orderspc.payName" readonly/>
            </Form-item>
            <Form-item label="快递费用" prop="shippingFee">
                <i-input v-model="orderspc.shippingFee" readonly/>
            </Form-item>
            <Form-item label="实际支付" prop="actualPrice">
                <i-input v-model="orderspc.actualPrice" readonly/>
            </Form-item>
            <Form-item label="订单总价" prop="orderPrice">
                <i-input v-model="orderspc.orderPrice" readonly/>
            </Form-item>
            <Form-item label="商品总价" prop="goodsPrice">
                <i-input v-model="orderspc.goodsPrice" readonly/>
            </Form-item>
            <Form-item label="下单时间" prop="addTime">
                <Date-picker v-model="orderspc.addTime" placeholder="使用时间" readonly/>
            </Form-item>
            <Form-item label="付款时间" prop="payTime">
                <Date-picker v-model="orderspc.payTime" placeholder="使用时间" readonly/>
            </Form-item>
            <Form-item label="配送费用" prop="freightPrice">
                <i-input v-model="orderspc.freightPrice" readonly/>
            </Form-item>
            <Form-item label="备注说明" prop="postscript">
                <i-input v-model="orderspc.postscript" placeholder="请在此处备注支付订单号以及相关说明。"/>
            </Form-item>
            <Form-item label="商品明细" prop="actualPrice">
                <table id="ordergoodsLookGrid"></table>
            </Form-item>
            <Form-item>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
            </Form-item>
        </i-form>
    </Card>

    <!--发货模块-->
    <Card v-show="!showList&&!detail&!showadd&!showconfirm">
        <p slot="title">{{title}}</p>
        <i-form :model="orderspc" :label-width="100">
            <!--<Form-item label="快递公司" prop="shippingId">-->
            <!--<i-select v-model="order.shippingId" filterable>-->
            <!--<i-option v-for="shipping in shippings" :value="shipping.id" :key="shipping.id">{{shipping.name}}-->
            <!--</i-option>-->
            <!--</i-select>-->
            <!--</Form-item>-->
            <Form-item label="快递单号" prop="logisticsno">
                <i-input v-model="orderspc.logisticsno" placeholder="快递单号"/>
            </Form-item>
            <Form-item label="物流名称" prop="name">
                <i-input v-model="logistics.name" placeholder="物流名称"/>
            </Form-item>
            <Form-item label="订单编号" prop="orderno">
                <i-input v-model="orderspc.orderNo" placeholder="订单编号"/>
            </Form-item>
            <Form-item label="状态" prop="statu">
                <i-select v-model="logistics.statu" placeholder="订单状态">
                    <i-option :value="1">已发货</i-option>
                    <i-option :value="2">已收货</i-option>
                </i-select>
            </Form-item>
            <Form-item label="产品编号" prop="pid">
                <i-input v-model="orderspc.productId" placeholder="产品编号"/>
            </Form-item>
            <Form-item label="产品名称" prop="pname">
                <i-input v-model="orderspc.productName" placeholder="产品名称"/>
            </Form-item>
            <Form-item label="数量" prop="num">
                <i-input v-model="orderspc.number" placeholder="数量"/>
            </Form-item>
            <Form-item label="用户编号" prop="userId">
                <i-input v-model="orderspc.userId" placeholder="用户编号"/>
            </Form-item>
            <Form-item label="用户名" prop="userName">
                <i-input v-model="orderspc.userName" placeholder="用户名"/>
            </Form-item>
            <Form-item label="手机" prop="phone">
                <i-input v-model="orderspc.userPhone" placeholder="手机"/>
            </Form-item>
            <Form-item label="备注" prop="remark">
                <i-input v-model="orderspc.remark" placeholder="备注" readonly/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="saveSend">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>
                返回</i-button>
            </Form-item>
        </i-form>
    </Card>
</div>
<script src="${rc.contextPath}/js/order/orderamount.js?_${date.systemTime}"></script>
</body>
</html>